#ifndef EDITDIALOG_H
#define EDITDIALOG_H
#include <QtGui>
#include <QDialog>
#include "webthumbnail.h"

class EditDialog : public QDialog
{
    Q_OBJECT
    void createWidgets();
    QLineEdit* name;
    QLineEdit* address;
    QLineEdit* tags;
    QPushButton* confirm;
    QPushButton* cancel;
    QImage* thumb;
    QLabel* thumbLbl;
    WebThumbnail* wt;
    QPixmap pix;

public:
    EditDialog();
    void setFields(QString& _name, QString& _addr, QString& _tags)
    {
        name->setText(_name);
        address->setText(_addr);
        tags->setText(_tags);
    }

    QString getName()
    {
        return name->text();
    }

    QStringList getTags()
    {
        return tags->text().split(",");
    }

    QString getAddress()
    {
        return address->text();
    }

    QPixmap getThumbs()
    {
        return pix;
    }



    void setName(const QString& s)
    {
        name->setText(s);
    }

    void setTags(const QStringList& s)
    {
        tags->setText(s.join(","));
    }

    void setAddress(const QString& s)
    {
        address->setText(s);
    }
public slots:
    void loadSnapshot(QString url);
    void loadLabel(bool);
};

#endif // EDITDIALOG_H
